package com.atguigu.tingshu.search.service;

import co.elastic.clients.elasticsearch.core.SearchRequest;
import co.elastic.clients.elasticsearch.core.SearchResponse;
import com.atguigu.tingshu.model.search.AlbumInfoIndex;
import com.atguigu.tingshu.query.search.AlbumIndexQuery;
import com.atguigu.tingshu.vo.search.AlbumSearchResponseVo;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface SearchService {


    void upperAlbum(Long albumId);

    void lowerAlbum(Long albumId);

    AlbumSearchResponseVo search(AlbumIndexQuery albumIndexQuery) throws IOException;

    SearchRequest buildDSL(AlbumIndexQuery AlbumIndexQuery);

    AlbumSearchResponseVo parseResult(AlbumIndexQuery query, SearchResponse<AlbumInfoIndex> searchResponse);

    List<Map<String, Object>> getChannel(Long category1Id);
    /**
     * 根据用户已录入字符查询提词索引库进行自动补全关键字
     * @param keyword
     * @return
     */
    List<String> completeSuggest(String keyword);

    void updateLatelyAlbumRanking();

    List<AlbumInfoIndex> findRankingList(Long category1Id, String dimension);
}
